package com.andy;

import com.andy.service.HelloService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;

public class DemoConsumerStarter {
    
    public static void main(String[] args){
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext("dubbo-comsumer.xml");
        context.start();

        System.out.println("consumer 启动完成");

        HelloService helloService = context.getBean(HelloService.class);

        while(true){
            String result = helloService.sayHello("tanzhongran");
            System.out.println("result="+result);

            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
